package q10.unittests;

import junit.framework.TestCase;
import q10.Functii.FunctiiElementare.*;
import q10.Arbori.*;

public class LnTest extends TestCase {
	
	Nod n;
	Nod nec=new Necunoscuta();

	protected void setUp() throws Exception {
		n=new Ln();
		n.setfStang(nec);
	}

	protected void tearDown() throws Exception {
		n=null;
	}

	public void testCalcul() {
		double rez=Math.log(this.n.getX());
		assertEquals(rez,this.n.calcul());
	}

	public void testDerivare() {
		String rez="1/".concat(this.n.getfStang().derivare());
		assertEquals(rez,this.n.derivare());
	}

	public void testCalculDerivata() {
		double rez=1/this.n.getfStang().calculDerivata();
		assertEquals(rez,this.n.calculDerivata());
	}

	public void testToString() {
		String rez="ln("+this.n.getfStang()+")";
		assertEquals(rez,this.n.toString());
	}

	public void testConcatTermeni() {
		String rez="ln("+this.n.getfStang()+")";
		assertEquals(rez,this.n.toString());	
	}

}
